package com.ruoyi.home.jinrong.service.impl;

import com.alibaba.fastjson.JSON;
import com.ruoyi.home.jinrong.entity.request.CwDealPerDaySearchPage;
import com.ruoyi.home.jinrong.entity.response.CwDealPerDayDetailPayDto;
import com.ruoyi.home.jinrong.entity.response.CwDealPerDayDto;
import com.ruoyi.home.jinrong.entity.response.CwDealPerDayTotalDto;
import com.ruoyi.home.jinrong.mapper.CwDealPerDayMapper;
import com.ruoyi.home.jinrong.service.CwDealPerDayService;
import org.checkerframework.checker.signature.qual.PolySignature;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 郭豪
 * @date 2021/8/1 19:24
 * @description:
 */
@Service
public class CwDealPerDayServiceImpl implements CwDealPerDayService {
    @Autowired
    private CwDealPerDayMapper cwDealPerDayMapper;

    /**
     * 营业报表用：分页查询    备注:(操作类型,1：收入，2：支出)
     * @param cwDealPerDaySearchPage
     */
    @Override
    public List<CwDealPerDayDto> searchCwDealPerDayPage(CwDealPerDaySearchPage cwDealPerDaySearchPage) {
        return cwDealPerDayMapper.searchCwDealPerDayPage(cwDealPerDaySearchPage);
    }

    public Integer getDataNum(CwDealPerDaySearchPage cwDealPerDaySearchPage){
        return cwDealPerDayMapper.getDataNum(cwDealPerDaySearchPage);
    }


    /**
     * 营业报表用：收入/支出 金额总计查询  备注:(操作类型,1：收入，2：支出)
     * @param cwDealPerDaySearchPage
     * @return
     */
    @Override
    public CwDealPerDayTotalDto searchCwDealPerDaySum(CwDealPerDaySearchPage cwDealPerDaySearchPage) {
        return cwDealPerDayMapper.searchCwDealPerDaySum(cwDealPerDaySearchPage);
    }

    public List<CwDealPerDayDetailPayDto> searchCwDealPerDayDetailPayPage(CwDealPerDaySearchPage param) {
        // 分页查询
        List<CwDealPerDayDetailPayDto> recordeList = cwDealPerDayMapper.searchCwDealPerDayDetailPayPage(param);
        return recordeList;
    }
}
